package com.zto.sch.base.normal;

import org.apache.commons.lang3.time.DateFormatUtils;

import java.time.LocalDate;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;

/**
 * @program: sch-diy-parent
 * @description:
 * @author: sch
 * @create: 2020-12-16 17:09
 **/
public class LocalDateJdk8 {
    public static void main(String[] args) {
        ZoneId zoneId = ZoneId.systemDefault();
        LocalDate today = LocalDate.now();
        ZonedDateTime zdt = today.atStartOfDay(zoneId);
        Date now = Date.from(zdt.toInstant());
        System.out.println(now);
        System.out.println(DateFormatUtils.format(now,"yyyy-MM-dd HH:mm:ss"));
    }
}
